/**
 * ****************************************************************************
 * Project: RoboBridge
 * ----------------------------------------------------------------------------
 * -------------------------- [c]2012 - KrawallMann ---------------------------
 * ---------------------- http://www.krawallmann.de.tc/ -----------------------
 * ****************************************************************************
 * File: Log.java Package: tc.de.krawallmann.robobridge.util Version: 1.0
 * Author(s): KrawallMann
 * ****************************************************************************
 * Description:
 * ****************************************************************************
 */
package tc.de.krawallmann.robobridge.util;

/**
 * ****************************************************************************
 * Project: RoboBridge2
 * ----------------------------------------------------------------------------
 * -------------------------- [c]2012 - KrawallMann ---------------------------
 * ---------------------- http://www.krawallmann.de.tc/ -----------------------
 * ****************************************************************************
 * File: Log.java Package: tc.de.krawallmann.robobridge Version: Author(s):
 * KrawallMann
 * ****************************************************************************
 * CHANGELOG AND LICENSING INFORMATION CAN BE FOUND AT THE END OF THIS FILE!
 * ****************************************************************************
 */

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * The Class Log is used for simplified logging.
 * 
 * @author KrawallMann
 * @version 1.0
 */
public final class Log {

	/**
	 * Log.
	 * 
	 * @param level
	 *            the level
	 * @param caller
	 *            the caller
	 * @param method
	 *            the method
	 * @param text
	 *            the text
	 * @param parameters
	 *            the parameters
	 */
	public static void log(final Level level, final Class<?> caller, final String method,
			final String text, final Object... parameters) {
		Logger.getLogger("RoboBridge").logp(level, caller.getName(), method, text, parameters);
	}

	/**
	 * Sets the level.
	 * 
	 * @param newLevel
	 *            the new level
	 */
	public static void setLevel(final Level newLevel) {
		final Logger topLogger = java.util.logging.Logger.getLogger("");
		topLogger.setLevel(Level.OFF);
		Logger.getLogger("RoboBridge").setLevel(newLevel);
	}

	/**
	 * Instantiates a new log.
	 */
	private Log() {
		super();
	}
}
